import { uploadFile } from '@/api/upload';
export const onUpload = async (blobInfo: any, success: any, failure: any, progress: any) => {
  var formData = new FormData();
  formData.append('file', blobInfo.blob(), blobInfo.filename());
  const res = await uploadFile(formData);
  console.log(res)
  if (res.success) {
    success(res.data[0].url);
  } else {
    failure('HTTP Error: ' + res.code);
  }
}
